package school.domain;

import java.io.Serializable;

public class School implements Serializable{
	private int schoolId;
	private String schoolName;
	private String schoolAddress;
	private String schoolTel;
	private String schoolFlower;
	private int enrolment;
	
	public School(){}
	public School(int schoolId, String schoolName, String schoolAddress,
			String schoolTel, String schoolFlower, int enrolment) {
		super();
		this.schoolId = schoolId;
		this.schoolName = schoolName;
		this.schoolAddress = schoolAddress;
		this.schoolTel = schoolTel;
		this.schoolFlower = schoolFlower;
		this.enrolment = enrolment;
	}
	public int getSchoolId() {
		return schoolId;
	}
	public void setSchoolId(int schoolId) {
		this.schoolId = schoolId;
	}
	public String getSchoolName() {
		return schoolName;
	}
	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}
	public String getSchoolAddress() {
		return schoolAddress;
	}
	public void setSchoolAddress(String schoolAddress) {
		this.schoolAddress = schoolAddress;
	}
	public String getSchoolTel() {
		return schoolTel;
	}
	public void setSchoolTel(String schoolTel) {
		this.schoolTel = schoolTel;
	}
	public String getSchoolFlower() {
		return schoolFlower;
	}
	public void setSchoolFlower(String schoolFlower) {
		this.schoolFlower = schoolFlower;
	}
	public int getEnrolment() {
		return enrolment;
	}
	public void setEnrolment(int enrolment) {
		this.enrolment = enrolment;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + enrolment;
		result = prime * result
				+ ((schoolAddress == null) ? 0 : schoolAddress.hashCode());
		result = prime * result
				+ ((schoolFlower == null) ? 0 : schoolFlower.hashCode());
		result = prime * result + schoolId;
		result = prime * result
				+ ((schoolName == null) ? 0 : schoolName.hashCode());
		result = prime * result
				+ ((schoolTel == null) ? 0 : schoolTel.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		School other = (School) obj;
		if (enrolment != other.enrolment)
			return false;
		if (schoolAddress == null) {
			if (other.schoolAddress != null)
				return false;
		} else if (!schoolAddress.equals(other.schoolAddress))
			return false;
		if (schoolFlower == null) {
			if (other.schoolFlower != null)
				return false;
		} else if (!schoolFlower.equals(other.schoolFlower))
			return false;
		if (schoolId != other.schoolId)
			return false;
		if (schoolName == null) {
			if (other.schoolName != null)
				return false;
		} else if (!schoolName.equals(other.schoolName))
			return false;
		if (schoolTel == null) {
			if (other.schoolTel != null)
				return false;
		} else if (!schoolTel.equals(other.schoolTel))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "School [schoolId=" + schoolId + ", schoolName=" + schoolName
				+ ", schoolAddress=" + schoolAddress + ", schoolTel="
				+ schoolTel + ", schoolFlower=" + schoolFlower + ", enrolment="
				+ enrolment + "]";
	}
	
}
